var size = 0;
var actsize = 0;
var images = [];
var imageLinks = [];
var biggestImg = "";

chrome.extension.onRequest.addListener(
  function(request, sender, sendResponse) {
	var result = document.getElementsByTagName("img");
	for (var key in result) {
		if (!isNaN(result[key].width)) {
			actsize = result[key].width * result[key].height;
			if (actsize > size) {
				biggestImg = result[key].src;
				size = (result[key].width * result[key].height);
			}	
			if(result[key].width>100)	{
				images.push(result[key].src);
			}
		}			
	}
	sendResponse({myBiggest: biggestImg,allImages: images});
});